package dynamicproxy;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/**
 * @author gaopeng
 * @date 2019/12/8 8:23 下午
 */
public class MyHandler implements InvocationHandler {
    /**
     * 被代理的实例
     */
    private Object obj;

    /**
     * 被代理者
     */
    private Class clazz;

    public MyHandler(Object obj) {
        this.obj = obj;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        return method.invoke(this.obj, args);
    }
}
